package com.example.mscloud.service;

import com.example.mscloud.common.entities.Payment;
import com.example.mscloud.common.entities.result.CommonResult;
import com.example.mscloud.service.impl.FeignOrderFallbackServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE", fallback = FeignOrderFallbackServiceImpl.class)
public interface FeignOrderService {

    @GetMapping("/payment/info/normal/{id}")
    CommonResult<Payment> normalPaymentInfo(@PathVariable("id") Long id);

    @GetMapping("/payment/info/timeout/{id}")
    CommonResult<Payment> timeoutPaymentInfo(@PathVariable("id") Long id);

    @GetMapping("/payment/info/exception/{id}")
    CommonResult<Payment> exceptionPaymentInfo(@PathVariable("id") Long id);

}
